cmake_minimum_required(VERSION 3.16)
project(Module)
set(CMAKE_CXX_STANDARD 17)
# # 查看目标库是否存在
if(TARGET safe_cmplib)
    MESSAGE(STATUS "safe_cmplib existed")
else()
    include(${CMAKE_CURRENT_SOURCE_DIR}/../build/cmake/global.cmake)
endif()

if (NAS)
    add_definitions(-D_NAS)
endif()
add_definitions(-DBOOST_FILESYSTEM_DEPRECATED)
add_definitions(-DBOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC)
add_subdirectory(log)
add_subdirectory(common)
add_subdirectory(config_reader)
add_subdirectory(threadpool)
add_subdirectory(metafile_parser)
add_subdirectory(parser)
add_subdirectory(system)
add_subdirectory(param_checker)
add_subdirectory(security)
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
    add_subdirectory(tracepoint)
    add_subdirectory(protocol)
    add_subdirectory(libobs_ctx)
    add_subdirectory(ndmp_client)
    add_subdirectory(curl_http)
    add_subdirectory(data_plane)
    add_subdirectory(utility)
endif()
if (NAS)
    add_subdirectory(io_device)
    add_subdirectory(layout)
    add_subdirectory(libnfs_ctx)
    add_subdirectory(libsmb_ctx)
    add_subdirectory(KMCv3_infra)
    add_subdirectory(device_access)
endif()